package com.panghl.service.impl;

import com.panghl.entity.Article;
import com.panghl.repository.ArticleDao;
import com.panghl.service.ArticleService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author panghl
 * @Date 2022/2/18
 **/
@Service
public class ArticleServiceImpl implements ArticleService {

    @Resource
    private ArticleDao articleDao;

    @Override
    public Article findByCategory(String category) {
        return articleDao.findByCategory(category);
    }

    @Override
    public Page<Article> findByCategoryLikeAndSort(String category, Pageable pageable) {
        return articleDao.findByCategoryLikeAndSort(category,pageable);
        //return null;
    }
}
